﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using ERP_RORZE_DLL.Product.DAO;
using ERP_RORZE_DLL.Product.database;

namespace ERP_RORZE.Product.BasicList
{
    public partial class frm_JigAdd : DevExpress.XtraEditors.XtraForm
    {
        public event EventHandler Reload;
        ClsBasicListDAO clsBasiclistDAO = new ClsBasicListDAO();
        Jig b = new Jig();

        public frm_JigAdd()
        {
            InitializeComponent();
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (txtJigName.Text == "")
            {
                MessageBox.Show("chưa nhập JigName");
            }
            else if (txtJigType.Text == "")
            {
                MessageBox.Show("chưa nhập JigType");
            }
            else
            {
                b.JigName = txtJigName.Text;
                b.JigType = txtJigType.Text;
                clsBasiclistDAO.InsertJig(b);
                Reload(sender, e);
            }
        }
    }
}